<me:UIVKPOS
    x:Class="WPFExcelReport.TFVKP"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"
    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM" 
    xmlns:WD="clr-namespace:WPFExcelReport;assembly=TWDECK"
    xmlns:WG="clr-namespace:WPFExcelReport;assembly=TWGBST"
    xmlns:VA="clr-namespace:WPFExcelReport;assembly=TVAART" 
    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN" 
    xmlns:WFW="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"
    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
    xmlns:ZB="clr-namespace:WPFExcelReport;assembly=TVKZUAB"  
    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
    xmlns:me="clr-namespace:WPFExcelReport"  
    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"  
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIVKPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:PreisConverter  x:Key="price"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVKPOS.Resources>
    <Grid Grid.Row="1" Grid.RowSpan="2"  Grid.Column="0" Grid.ColumnSpan="2" >
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <WrapPanel  >
                <TextBlock Text="{Binding Source={Localization:Translate Word=附加费}}"></TextBlock>
                <CheckBox IsChecked="{Binding IsShowBottom,ElementName=TV}"></CheckBox>
            </WrapPanel>
        </StackPanel>
        <DataGrid Grid.Row="1"  
                AutoGenerateColumns="False" 
                  EnableRowVirtualization="False"   
                  Name="dlgMaster"  IsReadOnly="True"  
                  ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" 
                  Width="Auto" Height="Auto"
                  EnableColumnVirtualization="True" HorizontalScrollBarVisibility="Auto"
                  VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridCheckBoxColumn Width="40" Binding="{Binding Path=IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGridRow}}}">
                    <DataGridCheckBoxColumn.HeaderTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="ckbSelectedAll" Checked="ckbSelectedAll_Click" Unchecked="ckbSelectedAll_Unchecked"></CheckBox>
                        </DataTemplate>
                    </DataGridCheckBoxColumn.HeaderTemplate>
                </DataGridCheckBoxColumn>
                <DataGridTextColumn Binding="{Binding Path=VKPSA}" Header="{Binding Source={Localization:Translate Word=有效}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="" Width="Auto" MinWidth="24" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD}" Header="{Binding Source={Localization:Translate Word=销售单}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header=" " Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=面料}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPPREIS, Converter={StaticResource ResourceKey=price}}" Header="{Binding Source={Localization:Translate Word=单价}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPPOSWERT}" Header="{Binding Source={Localization:Translate Word=本币价值}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=留位}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPFREIGE, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=发货}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPVERS, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=走货}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPOFFEN, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=开票}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPPOSTYP}" Header="{Binding Source={Localization:Translate Word=行类型}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAUFMART}" Header="{Binding Source={Localization:Translate Word=内包装}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPVERPART}" Header="{Binding Source={Localization:Translate Word=外包装}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPKDFARBNR, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=VKPKDBEZ, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=描述}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAENDBEN}" Header="{Binding Source={Localization:Translate Word=更改}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPAENDDAT}" Header="{Binding Source={Localization:Translate Word=日期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="{Binding Source={Localization:Translate Word=创建}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}" Header="{Binding Source={Localization:Translate Word=日期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
            </DataGrid.Columns>
        </DataGrid>
        <WrapPanel Grid.Row="2">
            <WrapPanel Grid.Row="2">
                <TextBlock Text="{Binding TKEY1}"  Margin="20,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TKEY2}"   Margin="20,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TCOUNT1}"   Margin="20,0,0,0"></TextBlock>
                <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            </WrapPanel>
            <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=更改}}"/>
            <TextBlock Grid.Column="1"  Text="{Binding VKPAENDBEN}" Width="Auto"/>
            <TextBlock Grid.Column="1"  Text="{Binding VKPAENDDAT}" Width="Auto"/>
            <TextBlock Grid.Column="1"  Text="{Binding VKPNEUBEN}" Width="Auto"/>
            <TextBlock Grid.Column="1"  Text="{Binding VKPSACHBE}" Width="Auto"/>
        </WrapPanel>
    </Grid>

</me:UIVKPOS>
